<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title>ckeditor5编译器使用</title>
    <script src="static/ckeditor/ckeditor.js"></script>
    <style>
        #fileSelect{
            width:100px;
            height: 100px;
            background: red;
            display: block;
        }
    </style>
</head>
<body>
        <input type="file" id="fileElem" multiple accept="image/*" style="display:none">

        <span id="fileSelect"></span>
    <!--/**
     * 图片上传 written :yangxingyi 2018-06-06 15:35 (ps,这是tp5的上传图片写法,其他编辑器的按要求写即可)
     */
    public function uploadImages($path=false,$save=false){
        $file = request()->file('upload');
        $path = $path?$path:ROOT_PATH . 'public/tmp/uploads/';
        $save = $save?$save:SITE_URL.'/tmp/uploads/';
        if($file){
            $info = $file->move($path);
            if($info){
                $url = $save.$info->getSaveName();// 成功上传后 获取上传信息
            }else{
                //$error = $file->getError();
            }
        }
        $url = str_replace("\\","/",$url);//把url的\换成/
       return json(['uploaded'=>true,'url'=>$url]);
    }-->
</body>
<script>
var fileSelect = document.getElementById("fileSelect"),
  fileElem = document.getElementById("fileElem");

fileSelect.addEventListener("click", function (e) {
  if (fileElem) {
    fileElem.click();
  }
  e.preventDefault(); // 避免导航到 "#"
}, false);
</script>
</html>